﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;

namespace DAL
{
    public class FoodTypeService
    {
        public static FoodType SelectByID(int id)
        {
            string sql = "select * from Food where Foodid=" + id;
            SqlDataReader dr = DBHelperSQL.GetDataReader(sql);

            List<FoodType> list = new List<FoodType>();
            FoodType FT = new FoodType();
            while (dr.Read())
            {
                FT.Typeid = (int)dr["Typeid"];
                FT.TypeName = dr["TypeName"].ToString();
            }
            dr.Close();
            return FT;
        }
    }
}